<div id="shop_id" class="c list_box">
	<input type="text" name="shop_name" class="input-text input-select" style="width:200px" autocomplete="off" readonly="1" placeholder="选择店铺" value="">
	<input type="hidden" name="shop_id" class="input-text input-select" style="width:200px" autocomplete="off" readonly="1" placeholder="选择店铺" value="">
	<div class="select" style="width:200px;">
		<ul>
		<?php 
		foreach(get_shop_all() as $v){
			echo '<label><li><input type="checkbox" data="'.$v['shop_id'].'" data2="'.$v['nick'].'"> '.$v['nick'].'</li></label>';
		}
		?>
		</ul>
	</div>
</div>
<script>
$('#shop_id.list_box').on('mouseover',function(){
	$(this).find('.select').show();
})

$('#shop_id.list_box').on('mouseout',function(){
	$(this).find('.select').hide();
})

$('#shop_id.list_box li input').click(function(){
	let shop_id = [];
	let shop_name = []
	$(this).parents('ul').find('input').each(function(){
		let obj = $(this); 
		if(obj.is(':checked')){
			shop_id.push(obj.attr('data'));
			shop_name.push(obj.attr('data2'));
		}
	})
	$(this).parents('.select').prev().val(shop_id.join(','));
	$(this).parents('.select').prev().prev().val(shop_name.join(','));
})
</script>